package com.lili.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lili.model.goods.GoodsCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface GoodsCategoryMapper extends BaseMapper<GoodsCategory> {
    /**
     * 查询所有的商品类别
     * @return
     */
    List<Map> queryCategoryTree();

    /**
     * 根据id禁用
     * @param id
     * @return
     */
    int modifyStatus(@Param("id") Long id,@Param("status") int status);

    /**
     * 根据pid查询所有的分类
     * @param pid
     * @return
     */
    List<GoodsCategory> queryByPid(Long pid);

    /**
     * 更新分类的信息
     * @param goodsCategory
     * @return
     */
    int updateCategory(GoodsCategory goodsCategory);

    /**
     * 根据id删除分类
     * @param id
     * @return
     */
    int deleteCategory(Long id);
}
